<template>
    <div>
        <ChildCom v-for="(item,index) in topics" :key="index">
            <template #title>帖子标题：{{ item.title }}</template>
            <template #content>帖子内容：{{ item.content }}</template>
            <template #poster>发帖人：{{ item.poster }}</template>
            <template #time>发帖时间：{{ item.time }}</template>
        </ChildCom>
    </div>
</template>

<script>
import ChildCom from './components/ChildCom.vue';
    export default{
        data(){
            return{
                topics:[
                    {
                        title:"我爱Vue",
                        content:"Vue不愧是前端王者！",
                        poster:"Jim",
                        time:"2023-11-16"
                    },
                    {
                        title:"关于具名插槽",
                        content:"什么事具名插槽呀？",
                        poster:"Lily",
                        time:"2023-12-2"
                    },
                    {
                        title:"组件太棒了",
                        content:"超赞的组件化开发！",
                        poster:"Bob",
                        time:"2023-12-13"
                    },
                ]
            }
        },
        components:{
            ChildCom
        }
    }
</script>

<style>
</style>